home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_cavedrops.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  91 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_CaveAmb.cog
  4. #
  5. # Based on code from TEO_Drops.cog by SXC.
  6. #
  7. # [TRM & SXC]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     entered
  15.     message     pulse
  16.     
  17.     thing       ghost
  18.     
  19.     sector      sec_On1     linkID=1
  20.     sector      sec_On2     linkID=1
  21.     sector      sec_Off1    linkID=0
  22.     sector      sec_Off2    linkID=0
  23.     
  24.     sound       sndCave0=teo_drops1_c.wav    local
  25.     sound       sndCave1=teo_drops2_c.wav    local
  26.     sound       sndCave2=teo_drops3_c.wav    local
  27.     sound       sndCave3=teo_drops4_c.wav    local
  28.  
  29.     float       caveFreq        local
  30.     
  31.     flex        vol=1.0
  32.     flex        minDist=-1
  33.     flex        maxDist=-1
  34.     
  35.     int         playing=0       local
  36.     
  37. end
  38.  
  39. # ========================================================================================
  40.  
  41. code
  42.  
  43. entered:
  44.  
  45.     if((GetSenderID() == 1) && (playing == 0))
  46.     {
  47.         playing = 1;
  48.         SetPulse(2.0);
  49.     }
  50.     
  51.     if((GetSenderID() == 0) && (playing == 1))
  52.     {
  53.         playing = 0;
  54.         SetPulse(0.0);
  55.     }
  56.     
  57.     return;
  58.     
  59. # ========================================================================================
  60.  
  61. pulse:
  62.     
  63.     caveFreq = Rand();
  64.  
  65.     if (caveFreq < 0.16)
  66.     {
  67.         PlaySoundThing(sndCave0, ghost, vol, minDist, maxDist, 0x0);
  68.     }
  69.         
  70.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  71.     {
  72.         PlaySoundThing(sndCave1, ghost, vol, minDist, maxDist, 0x0);
  73.     }
  74.         
  75.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  76.     {
  77.         PlaySoundThing(sndCave2, ghost, vol, minDist, maxDist, 0x0);
  78.     }
  79.     
  80.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  81.     {
  82.         PlaySoundThing(sndCave3, ghost, vol, minDist, maxDist, 0x0);
  83.     }
  84.     
  85.     return;
  86.     
  87. # ========================================================================================
  88.         
  89. end
  90.  
  91.